/**
 * 20220121：finalized by jordia
 */
import Vec3 from "../../common/vec3";
import Method from "../../common/method";

/**
 * 扩展多边形顶点
 */
export default class EpaVertex {
    constructor() {
        this.randId = Math.random() * 100000 | 0;
        this.v = new Vec3();
        this.w1 = new Vec3();
        this.w2 = new Vec3();
    }
    init(v,w1,w2) {
        Method.copyElements(v.elements,this.v.elements,0,0,3);
        Method.copyElements(w1.elements,this.w1.elements,0,0,3);
        Method.copyElements(w2.elements,this.w2.elements,0,0,3);
        this._next = null;
        this._tmpEdgeLoopNext = null;
        this._tmpEdgeLoopOuterTriangle = null;
        return this;
    }
    removeReferences() {
        this._next = null;
        this._tmpEdgeLoopNext = null;
        this._tmpEdgeLoopOuterTriangle = null;
    }
}